<!--  -->
<template>
    <div class="search">
        <el-select v-model="value" placeholder="请选择要查询的状态" style="width: 250px">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <el-button type="primary" @click="search">查询</el-button>
        <el-button @click="reset">重置</el-button>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import $bus from '../../bus';
let $emit = defineEmits(['getApplyInfo'])
console.log('emit', $emit);

let props = defineProps(['paginationData'])
const value = ref('')

const options = [
    {
        value: '0',
        label: '待审核',
    },
    {
        value: '1',
        label: '审核通过',
    },
    {
        value: '2',
        label: '审核不通过',
    },
    {
        value: '3',
        label: '申请已撤销',
    }
]
// 重置 
const reset = () => {
    value.value = ''
    $emit('getApplyInfo', props.paginationData.currentPage, props.paginationData.pageSize, '')
}
// 查询
const search = () => {
    let keyword = value.value
    $emit('getApplyInfo', props.paginationData.currentPage, props.paginationData.pageSize, keyword)
    $bus.emit('keyword', keyword)
}
</script>

<style lang="scss" scoped>
.el-select {
    margin-right: 15px;
}

.search {
    margin: 10px 0 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
</style>